local TileManager = require "packages.mahjong.riichi_mahjong.core.tile_manager"

---@class RiichiMahjong.Engine : Base.Engine, RiichiMahjong.TileManager
local Engine = Fk.Base.Engine:subclass("RiichiMahjong.Engine")
Engine:include(TileManager)

function Engine:initialize()
  Fk.Base.Engine.initialize(self)
  self:initManager()
end

function Engine:initializeMahjong()
  local Tile = require "packages.mahjong.riichi_mahjong.core.tile"
  for _, suit in ipairs(Tile.Suits) do
    if suit == 'z' then
      for number = 1,7,1 do
        for _ = 1,4,1 do
          self:CreateTile(suit, number)
        end
      end
    else
      for number = 1,9,1 do
        if number == 5 then
          for _ = 1,3,1 do
            self:CreateTile(suit, number)
          end
          self:CreateTile(suit, 0)
        else
          for _ = 1,4,1 do
            self:CreateTile(suit, number)
          end
        end
      end
    end
  end
end


return Engine
